package main

func main() {

}

func largestTriangleArea(points [][]int) float64 {
	n := len(points)
	res := 0.0
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			for k := j + 1; k < n; k++ {
				a := area(points[i], points[j], points[k])
				if a > res {
					res = a
				}
			}
		}
	}
	return res
}

//鞋带公式，计算三角形面积，输入参数P,Q,R均为长度为2的数组，表示三点坐标
func area(P, Q, R []int) float64 {
	var res = 0.5 * float64(P[0]*Q[1]+Q[0]*R[1]+R[0]*P[1]-P[1]*Q[0]-Q[1]*R[0]-R[1]*P[0])
	if res < 0 {
		return -res
	}
	return res
}
